﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MobilTomegSzerverDB
{
    public class DBManager
    {
        #region Properties

        public static mobiltomegEntities db;
        public static mobiltomegEntities DB
        {
            get
            {
                if (db == null)
                {
                    db = new mobiltomegEntities();
                }
                return db;
            }
        }

        #endregion

        public static a_update GetUpdate()
        {
            try
            {
                int version = DB.a_update.Max(u => u.version);
                return db.a_update.FirstOrDefault(u => u.version == version);
            }
            catch
            {
                return new a_update { ID = 0, version = 0, data = "", date = 0 };
            }
        }
    }
}
